-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-raise encountered exceptions in pilot tests #2754
Conversation
… pilot-exceptions
To keep in mind for when this PR settles and/or is ready to merge: the fix that's in here for So when this lands we need to be 100% sure that it doesn't reintroduce #2557 and if it does (I suspect it might actually), thanks to #2582 being fixed, we can likely actually fix #2557 using the rebuild in |
I've confirmed that this doesn't break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just one question.
This is probably an edge-case that wasn't covered in the original PR that introduced the machinery (namely App._exception and App._exception_event) that I want to leverage here. Related PRs: #2754
When an exception was raised in a pilot test, it prevented logic in
_wait_for_screen
from working correctly (counters would never decrement to zero). The result was that when exceptions occurred, it always timed out.We now record the first exception that occurs in an app, and we re-raise that exception in the
__aexit__
of the context manager returned byrun_test
, so that tests fail and test frameworks will print the stack trace.We now detect if an exception occurs and set an event. If the event is set, then
_wait_for_screen
won't wait for the timeout to be reached allowing it to exit early.